<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="vue.js"></script>
  <style>
    .box1{
      width: 200px;
      height: 200px;
      background: rgb(194, 5, 5);
    }
    .box2{
      width: 200px;
      height: 200px;
      background: rgb(244, 248, 14);
    }
    .bgg{
      background: green;
    }
  </style>
</head>
<body>
  <div id="app">
    <div :class="a"></div>
    <hr>
    <div :class="b"></div>
    <hr>
    <div :class="[a,c]"></div>
    <hr>
    <div :class="{ active:false }"></div>  
    <!-- {} 比较重要 -->
    <hr>
    <div :class="[a,{active:isActive}]"></div>
  </div>
  <script>
    let vm = new Vue({
      el:"#app",
      data:{
        a:"box1",
        b:["box1","bgg"],
        c:"bgg",
        isActive:true
      }
    })
  </script>
</body>
</html>